package com.slz3.business.module.configManagement.conZoneTemplate.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conZoneTemplate.domain.ConZoneTemplate;
import com.slz3.business.module.configManagement.conZoneTemplate.domain.ConZoneTemplateCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class ConZoneTemplateResAtomic {

    public Mono<ServerResponse> add_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplate conZoneTemplate) {
        return ConZoneTemplateResSafeValid.add(req, conZoneTemplate) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.add(req, conZoneTemplate);
    }

    public Mono<ServerResponse> delete_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplateCondition conZoneTemplateCondition) {
        return ConZoneTemplateResSafeValid.delete(req, conZoneTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplate conZoneTemplate) {
        return ConZoneTemplateResSafeValid.modify(req, conZoneTemplate) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.modify(req, conZoneTemplate);
    }

    public Mono<ServerResponse> info_$ConZoneTemplateUpdateLock(ServerRequest req) {
        return ConZoneTemplateResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplateCondition conZoneTemplateCondition) {
        return ConZoneTemplateResSafeValid.auditSubmit(req, conZoneTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplateCondition conZoneTemplateCondition) {
        return ConZoneTemplateResSafeValid.audit(req, conZoneTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplateCondition conZoneTemplateCondition) {
        return ConZoneTemplateResSafeValid.auditReject(req, conZoneTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplateCondition conZoneTemplateCondition) {
        return ConZoneTemplateResSafeValid.usingEnable(req, conZoneTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$ConZoneTemplateUpdateLock(ServerRequest req, ConZoneTemplateCondition conZoneTemplateCondition) {
        return ConZoneTemplateResSafeValid.usingDisable(req, conZoneTemplateCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                ConZoneTemplateResExecutor.usingDisable(req);
    }
}
